//window.plugins.webintent.write({ input: 'val1'});

var ReaderPlugin = function() {
};
ReaderPlugin.prototype.write = function(params, success, fail) {
	return PhoneGap.exec(success, fail, 'ReaderPlugin', 'startActivity',
			[ params ]);
};

var nfc = {
	addnListener : function(callback, win, fail) {
		document.addEventListener("ndef", callback, false);
		PhoneGap.exec(win, fail, "ReaderPlugin", "registerNdef", []);
	}
}

nfc.addnListener(parseTag, parseTag, function() {
	console.log("Fail.");
});

var nfcData = function(test) {
	alert(test);
}

function parseTag(nfcEvent) {
	alert("hello world");
	//var records = nfcEvent.value;
	//alert(records);
	//display = document.getElementById("tagContents");
}

PhoneGap.addConstructor(function() {
	PhoneGap.addPlugin('ReaderPlugin', new ReaderPlugin());
	/**
	 * PluginManager .addService('PluginWriter',
	 * 'com.a.plugin.writer.PluginWriter');
	 */
});